package com.distribute.framework.model;

import com.distribute.framework.core.web.helper.Utils;
import java.lang.reflect.Field;
import java.util.Date; 
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;

import javax.annotation.Resource;

import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.core.lang.*; 
import com.distribute.framework.core.web.helper.WebHelper.LzMap;
import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.util.IbatisMap;
import com.distribute.framework.config.*;
import com.distribute.framework.plugin.*;

@namespace("partner/partners")
public @caption("合伙人信息") @database(DatabaseNames.distribute_sys) @source("distribute_sys") @table("tb_partners") class TbPartners implements java.io.Serializable
{
	private static final long serialVersionUID = 1l;
		
	
		
	private @caption("编号") @column("tbp_id")    @primary  @notnull  @note("  ") Long tbpId;// 主键 非空     
			
 			
 			
 		
	
		
	private transient @caption("会员名称") @column("nick_name") @like     @note("  ") String nickName;//     
			
 			
 			
 		
	
		
	private @caption("会员") @column("tbp_member")   @hidden    @relate("$tbpMember") @RelateClass(Member.class)  @note("  ") Long tbpMember;//     
			
 	private transient Member $tbpMember;//关联对象[会员信息]
 			
 			
 			
 		
	
		
	private @caption("品牌") @column("tbp_brand")      @relate("$tbpBrand") @RelateClass(Merchant.class)  @note("  ") Long tbpBrand;//     
			
 	private transient Merchant $tbpBrand;//关联对象[品牌信息]
 			
 			
 			
 		
	
		
	private @caption("姓名") @column("tbp_name") @like     @note("  ") String tbpName;//     
			
 			
 			
 		
	
		
	private @caption("手机号") @column("tbp_mobile") @like     @note("  ") String tbpMobile;//     
			
 			
 			
 		
	
		
	private @caption("上级") @column("tbp_top") @like     @note("  ") String tbpTop;//     
			
 			
 			
 		
	
		
	private @caption("上上级") @column("tbp_toptop") @like     @note("  ") String tbpToptop;//     
			
 			
 			
 		
	
		
	private @caption("性别") @column("tbp_sex") @like     @note("  ") String tbpSex;//     
			
 			
 			
 		
	
		
	private @caption("年龄") @column("tbp_age") @like     @note("  ") String tbpAge;//     
			
 			
 			
 		
	
		
	private @caption("收入") @column("tbp_sr") @like     @note("  ") String tbpSr;//     
			
 			
 			
 		
	
		
	private @caption("职业") @column("tbp_zy") @like     @note("  ") String tbpZy;//     
			
 			
 			
 		
	
		
	private @caption("全称") @column("tbp_full_name") @like     @note("  ") String tbpFullName;//     
			
 			
 			
 		
	
		
	private @caption("街道地址") @column("tbp_jiedao")      @relate("$tbpJiedao") @RelateClass(Region.class)  @note("  ") Long tbpJiedao;//     
			
 	private transient Region $tbpJiedao;//关联对象[省市地区]
 			
 			
 			
 		
	
		
	private @caption("审核理由") @column("tbp_liyou") @like     @note("  ") String tbpLiyou;//     
			
 			
 			
 		
	
		
	private @caption("经度") @column("tbp_longitude")   @hidden    @note("  ") String tbpLongitude;//     
			
 			
 			
 		
	
		
	private @caption("纬度") @column("tbp_latitude")   @hidden    @note("  ") String tbpLatitude;//     
			
 			
 			
 		
	
		
	private @caption("省") @column("tbp_province")   @hidden    @note("  ") Long tbpProvince;//     
			
 			
 			
 		
	
		
	private @caption("市") @column("tbp_city")   @hidden    @note("  ") Long tbpCity;//     
			
 			
 			
 		
	
		
	private @caption("县") @column("tbp_county")   @hidden    @note("  ") Long tbpCounty;//     
			
 			
 			
 		
	
		
	private @caption("申请时间") @column("tbp_time")      @note("  ") Date tbpTime;//     
			
 			
 			
 		
	
		
	private @caption("是否购买卡") @column("tbp_pay_card")      @note(" 1:未购买 2:已购买  ") Short tbpPayCard;// 1:未购买 2:已购买     
			
 			
 			
 		
	
		
	private @caption("审核状态") @column("tbp_auth")      @note(" 1:待处理 2:通过 3:不通过  ") Short tbpAuth;// 1:待处理 2:通过 3:不通过     
			
 			
 			
 		
	
		
	private @caption("添加时间") @column("tbp_add_time")      @note("  ") Date tbpAddTime;//     
			
 			
 			
 		
	
	 
	//默认构造函数
	public TbPartners(){ 
	
	}
	
	//主键构造函数
	public TbPartners(Long id){
		this.tbpId = id;
	}
	
	/**所有字段构造函数 
	 TbPartners(
	 	Utils.getLong("member")//会员
	 	,Utils.getLong("brand")//品牌
	 	,Utils.getString("name")//姓名
	 	,Utils.getString("mobile")//手机号
	 	,Utils.getString("top")//上级
	 	,Utils.getString("toptop")//上上级
	 	,Utils.getString("sex")//性别
	 	,Utils.getString("age")//年龄
	 	,Utils.getString("sr")//收入
	 	,Utils.getString("zy")//职业
	 	,Utils.getString("fullName")//全称
	 	,Utils.getLong("jiedao")//街道地址
	 	,Utils.getString("liyou")//审核理由
	 	,Utils.getString("longitude")//经度
	 	,Utils.getString("latitude")//纬度
	 	,Utils.getLong("province")//省
	 	,Utils.getLong("city")//市
	 	,Utils.getLong("county")//县
	 	,Utils.getDate("time")//申请时间
	 	,Utils.getShort("payCard")//是否购买卡
	 	,Utils.getShort("auth")//审核状态
	 	,Utils.getDate("addTime")//添加时间
	 )
	**/
	public TbPartners(Long tbpMember,Long tbpBrand,String tbpName,String tbpMobile,String tbpTop,String tbpToptop,String tbpSex,String tbpAge,String tbpSr,String tbpZy,String tbpFullName,Long tbpJiedao,String tbpLiyou,String tbpLongitude,String tbpLatitude,Long tbpProvince,Long tbpCity,Long tbpCounty,Date tbpTime,Short tbpPayCard,Short tbpAuth,Date tbpAddTime){
		
			
			
			
		this.tbpMember=tbpMember;
		
			
		this.tbpBrand=tbpBrand;
		
			
		this.tbpName=tbpName;
		
			
		this.tbpMobile=tbpMobile;
		
			
		this.tbpTop=tbpTop;
		
			
		this.tbpToptop=tbpToptop;
		
			
		this.tbpSex=tbpSex;
		
			
		this.tbpAge=tbpAge;
		
			
		this.tbpSr=tbpSr;
		
			
		this.tbpZy=tbpZy;
		
			
		this.tbpFullName=tbpFullName;
		
			
		this.tbpJiedao=tbpJiedao;
		
			
		this.tbpLiyou=tbpLiyou;
		
			
		this.tbpLongitude=tbpLongitude;
		
			
		this.tbpLatitude=tbpLatitude;
		
			
		this.tbpProvince=tbpProvince;
		
			
		this.tbpCity=tbpCity;
		
			
		this.tbpCounty=tbpCounty;
		
			
		this.tbpTime=tbpTime;
		
			
		this.tbpPayCard=tbpPayCard;
		
			
		this.tbpAuth=tbpAuth;
		
			
		this.tbpAddTime=tbpAddTime;
		
	}
	
	//设置非空字段
	public TbPartners setNotNull(){
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		return this;
	}
	
	
		
	/** 编号 [非空]       **/
	public TbPartners tbpId(Long tbpId){
		this.tbpId = tbpId;
		this.setSeted(F.tbpId);
		return this;
	}
	
		
		
	/** 会员  [Member]      **/
	public TbPartners tbpMember(Long tbpMember){
		this.tbpMember = tbpMember;
		this.setSeted(F.tbpMember);
		return this;
	}
	
		
	/** 品牌  [Merchant]      **/
	public TbPartners tbpBrand(Long tbpBrand){
		this.tbpBrand = tbpBrand;
		this.setSeted(F.tbpBrand);
		return this;
	}
	
		
	/** 姓名        **/
	public TbPartners tbpName(String tbpName){
		this.tbpName = tbpName;
		this.setSeted(F.tbpName);
		return this;
	}
	
		
	/** 手机号        **/
	public TbPartners tbpMobile(String tbpMobile){
		this.tbpMobile = tbpMobile;
		this.setSeted(F.tbpMobile);
		return this;
	}
	
		
	/** 上级        **/
	public TbPartners tbpTop(String tbpTop){
		this.tbpTop = tbpTop;
		this.setSeted(F.tbpTop);
		return this;
	}
	
		
	/** 上上级        **/
	public TbPartners tbpToptop(String tbpToptop){
		this.tbpToptop = tbpToptop;
		this.setSeted(F.tbpToptop);
		return this;
	}
	
		
	/** 性别        **/
	public TbPartners tbpSex(String tbpSex){
		this.tbpSex = tbpSex;
		this.setSeted(F.tbpSex);
		return this;
	}
	
		
	/** 年龄        **/
	public TbPartners tbpAge(String tbpAge){
		this.tbpAge = tbpAge;
		this.setSeted(F.tbpAge);
		return this;
	}
	
		
	/** 收入        **/
	public TbPartners tbpSr(String tbpSr){
		this.tbpSr = tbpSr;
		this.setSeted(F.tbpSr);
		return this;
	}
	
		
	/** 职业        **/
	public TbPartners tbpZy(String tbpZy){
		this.tbpZy = tbpZy;
		this.setSeted(F.tbpZy);
		return this;
	}
	
		
	/** 全称        **/
	public TbPartners tbpFullName(String tbpFullName){
		this.tbpFullName = tbpFullName;
		this.setSeted(F.tbpFullName);
		return this;
	}
	
		
	/** 街道地址  [Region]      **/
	public TbPartners tbpJiedao(Long tbpJiedao){
		this.tbpJiedao = tbpJiedao;
		this.setSeted(F.tbpJiedao);
		return this;
	}
	
		
	/** 审核理由        **/
	public TbPartners tbpLiyou(String tbpLiyou){
		this.tbpLiyou = tbpLiyou;
		this.setSeted(F.tbpLiyou);
		return this;
	}
	
		
	/** 经度        **/
	public TbPartners tbpLongitude(String tbpLongitude){
		this.tbpLongitude = tbpLongitude;
		this.setSeted(F.tbpLongitude);
		return this;
	}
	
		
	/** 纬度        **/
	public TbPartners tbpLatitude(String tbpLatitude){
		this.tbpLatitude = tbpLatitude;
		this.setSeted(F.tbpLatitude);
		return this;
	}
	
		
	/** 省        **/
	public TbPartners tbpProvince(Long tbpProvince){
		this.tbpProvince = tbpProvince;
		this.setSeted(F.tbpProvince);
		return this;
	}
	
		
	/** 市        **/
	public TbPartners tbpCity(Long tbpCity){
		this.tbpCity = tbpCity;
		this.setSeted(F.tbpCity);
		return this;
	}
	
		
	/** 县        **/
	public TbPartners tbpCounty(Long tbpCounty){
		this.tbpCounty = tbpCounty;
		this.setSeted(F.tbpCounty);
		return this;
	}
	
		
	/** 申请时间        **/
	public TbPartners tbpTime(Date tbpTime){
		this.tbpTime = tbpTime;
		this.setSeted(F.tbpTime);
		return this;
	}
	
		
	/** 是否购买卡    1:未购买 2:已购买     **/
	public TbPartners tbpPayCard(Short tbpPayCard){
		this.tbpPayCard = tbpPayCard;
		this.setSeted(F.tbpPayCard);
		return this;
	}
	
		
	/** 审核状态    1:待处理 2:通过 3:不通过     **/
	public TbPartners tbpAuth(Short tbpAuth){
		this.tbpAuth = tbpAuth;
		this.setSeted(F.tbpAuth);
		return this;
	}
	
		
	/** 添加时间        **/
	public TbPartners tbpAddTime(Date tbpAddTime){
		this.tbpAddTime = tbpAddTime;
		this.setSeted(F.tbpAddTime);
		return this;
	}
	
	
	
	/**
	* 克隆对象
	**/
	public TbPartners clone(){
		TbPartners clone = new TbPartners();
		
			
			
			
		clone.tbpMember=this.tbpMember;
		
			
		clone.tbpBrand=this.tbpBrand;
		
			
		clone.tbpName=this.tbpName;
		
			
		clone.tbpMobile=this.tbpMobile;
		
			
		clone.tbpTop=this.tbpTop;
		
			
		clone.tbpToptop=this.tbpToptop;
		
			
		clone.tbpSex=this.tbpSex;
		
			
		clone.tbpAge=this.tbpAge;
		
			
		clone.tbpSr=this.tbpSr;
		
			
		clone.tbpZy=this.tbpZy;
		
			
		clone.tbpFullName=this.tbpFullName;
		
			
		clone.tbpJiedao=this.tbpJiedao;
		
			
		clone.tbpLiyou=this.tbpLiyou;
		
			
		clone.tbpLongitude=this.tbpLongitude;
		
			
		clone.tbpLatitude=this.tbpLatitude;
		
			
		clone.tbpProvince=this.tbpProvince;
		
			
		clone.tbpCity=this.tbpCity;
		
			
		clone.tbpCounty=this.tbpCounty;
		
			
		clone.tbpTime=this.tbpTime;
		
			
		clone.tbpPayCard=this.tbpPayCard;
		
			
		clone.tbpAuth=this.tbpAuth;
		
			
		clone.tbpAddTime=this.tbpAddTime;
		
		return clone;
	}
	
	
	
	
	
	/**
	 * 根据ID取合伙人信息
	 * @param id
	 * @return
	 */
	public static @api TbPartners get(Long id){		
		return getTbPartnersById(id);
	}
	
	
	/**
	 * 设置ID
	 * @param id
	 * @return
	 */
	public void setId(Long id){		
		this.tbpId = id;
	}
	
	
	/**
	 * 获取所有合伙人信息
	 * @return
	 */
	public static @api List<TbPartners> list(Map params,Integer size){
		return getTbPartnersList(params,size);
	}
	/**
	 * 获取合伙人信息分页
	 * @return
	 */
	public static @api Page<TbPartners> page(Integer page,Integer size,Map params){
		return getTbPartnersPage(page, size , params);
	}
	
	
	/**
	 * 根据查询条件取合伙人信息
	 * @param params
	 * @return
	 */
	public static @api TbPartners Get(Map params){
		return getTbPartners(params);
	}
	/**
	 * 获取合伙人信息数
	 * @return
	 */
	public static @api Long count(Map params){
		return getTbPartnersCount(params);
	}
	/**
	 * 获取合伙人信息数
	 * @return
	 */
	public static @api <T> T eval(String eval,Map params){
		return getTbPartnersEval(eval,params);
	}
	
	
	/**
	 * 获取合伙人信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey){
		return getTbPartnersStats(params,sumKey,groupKey,-1);
	}
	/**
	 * 获取合伙人信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey,int dateType){
		return getTbPartnersStats(params,sumKey,groupKey,dateType);
	}
	
	
	/**
	 * 根据ID取合伙人信息
	 * @param id
	 * @return
	 */
	public static @api TbPartners getTbPartnersById(Long id){		
		return getTbPartnersDao().getTbPartnersById(id);
	}
	
	
	/**
	 * 获取id
	 * @return
	 */
	public Long getId(){
		return this.tbpId;
	}
	
	
	
	/**
	 * 根据ID取合伙人信息的标识键值
	 * @param id
	 * @return
	 */
	public static @api String getKeyValue(Object key){
		Long id = Utils.parseLong(key);	
		if(id==null || id.longValue()==0 ){
			
			return null;
			
		}
		String value = null;
		
		value = Cache.getValue(TbPartners.class, id);
				
		if(value==null){
			TbPartners tbPartners = get(id);
			if(tbPartners!=null){
				String strValue = tbPartners.getTbpId$();
				
				
				Cache.setValue(TbPartners.class, id ,strValue);
				
				value = strValue;
			}else{
				
				Cache.setValue(TbPartners.class, id ,"{"+id+"}",30);
				
				value = "{"+id+"}";
			}
		}
		
		/************LAZY3Q_ID_KEYVALUE************/
		/************LAZY3Q_ID_KEYVALUE************/
		return value;
	}	
	
	
	/**
	 * 获取当前对象的键值
	 * @return
	 */
	public String getKeyValue(){
		
		/************LAZY3Q_CODE_KEYVALUE************/
		/************LAZY3Q_CODE_KEYVALUE************/
		String keyValue = this.getTbpId$();
		
		return keyValue;
	}
	
	
	/**
	 * 根据关键字精确查询合伙人信息对象
	 * @return
	 */
	public static @api TbPartners find(String key){
		if(Utils.empty(key))return null;
		Map params = new HashMap();
		if(key.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
			params.put("tbpId", key.toLowerCase().replaceFirst("id:", ""));					
		else{//按标识查询，精确查询
			String strDefinex = "";
			
			strDefinex="(2=1 "+strDefinex+")";
			params.put("definex",strDefinex);
		}
		
		/************LAZY3Q_CODE_FIND************/
		/************LAZY3Q_CODE_FIND************/
		return TbPartners.getTbPartners(params);
	}
	
	
	/**
	 * 根据关键字查询合伙人信息
	 * @return
	 */
	public static @api List<Map> query(String key,int size,Map params,Boolean bObject){
		if(Utils.empty((String)params.get("asc")) && Utils.empty((String)params.get("desc")))//如果未传入排序字段
			params.put("desc","tbp_id");//那么，默认以主键降序，传给Dao层
		String strTerm=key;		
		if(!Utils.empty(strTerm)){
			if(strTerm.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
				params.put("tbpId", strTerm.toLowerCase().replaceFirst("id:", ""));					
			else//按标识查询，模糊查询请带%
			{
				String strDefinex = "";
				
				strDefinex="(2=1 "+strDefinex+")";
				params.put("definex",strDefinex);
			}
		}
		
		
		/************LAZY3Q_CODE_QUERY************/
		/************LAZY3Q_CODE_QUERY************/
			
		List<TbPartners> list = page(0,size,params).getResult();
		
		/**
		* OK!取到数据拼成放入Map中，[{value,text,object:{...}},...]
		* value:数据ID，text:数据标识,object,整个对象
		**/
		List<Map> result = new java.util.ArrayList();
		for(TbPartners tbPartners:list){
			Map map = new HashMap();
			map.put("key",tbPartners.getTbpId().toString());
			map.put("value", Utils.js(tbPartners.getKeyValue()));
			if(bObject==true)
				map.put("object",tbPartners);
			result.add(map);
		}
		
		
		/************LAZY3Q_AFTER_QUERY************/
		/************LAZY3Q_AFTER_QUERY************/
		
		return result;
	}
	
	
	
	/**
	 * 获取所有合伙人信息
	 * @return
	 */
	public static @api List<TbPartners> getTbPartnersList(Map params,Integer size){
		return getTbPartnersDao().getTbPartnersList(params,0,size);
	}
	
	/**
	 * 获取合伙人信息分页
	 * @return
	 */
	public static @api Page<TbPartners> getTbPartnersPage(Integer page,Integer size,Map params){
		if(page==null)page=0;
		if(size==null)size=20;
		return getTbPartnersDao().getTbPartnersPage(page, size , params);
	}
	
	/**
	 * 根据查询条件取合伙人信息
	 * @param params
	 * @return
	 */
	public static @api TbPartners getTbPartners(Map params){
		return getTbPartnersDao().getTbPartners(params);
	}
	
	/**
	 * 保存一个合伙人信息
	 * @param tbPartners
	 * @return
	 */
	public static @api TbPartners saveTbPartners(TbPartners tbPartners){
		return getTbPartnersDao().saveTbPartners(tbPartners);
	}
	
	/**
	 * 根据条件更新合伙人信息
	 * @param values
	 * @param params
	 */
	public static @api int updateTbPartnersByConfirm(Map values, Map params){
		return getTbPartnersDao().updateTbPartnersByConfirm(values,params);
	}
	
	/**
	 * 修改一个合伙人信息
	 * @param tbPartners
	 * @return
	 */
	public static @api int updateTbPartners(TbPartners tbPartners){
		return getTbPartnersDao().updateTbPartners(tbPartners);
	}
	
	/**
	 * 更新合伙人信息非空字段
	 * @param tbPartners
	 */
	public static @api int updateTbPartners$NotNull(TbPartners tbPartners){
		return getTbPartnersDao().updateTbPartners$NotNull(tbPartners);
	}
	
	/**
	 * 获取合伙人信息数
	 * @return
	 */
	public static @api Long getTbPartnersCount(Map params){
		return getTbPartnersDao().getTbPartnersCount(params);
	}
		
		
	/**
	 * 获取合伙人信息自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public static @api <T> T getTbPartnersEval(String eval,Map params){
		return getTbPartnersDao().getTbPartnersEval(eval,params);
	}
	
	
	/**
	 * 获取合伙人信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> getTbPartnersStats(Map params,C sumKey,C groupKey,int dateType){
		//TODO:图表统计功能未实现
		
		Map<String,Object> groups=new HashMap();//要分组的字段
		Map<String,Object> sums=new HashMap();//要统计的字段
		
		String[][] dateFormats=new String[][]{
				null,
				new String[]{"%Y","yyyy年","Y"},
				new String[]{"%Y-%m","yyyy年MM月","M"},
				new String[]{"%Y%U","yyyy年第ww周","W"},
				new String[]{"%Y-%m-%d","yyyy年MM月dd日","D"},
				new String[]{"%Y-%m-%d %H","yyyy年MM月dd日 HH点","H"},
				new String[]{"%m","MM月"},
				new String[]{"%d","dd号"},
				new String[]{"%H","HH点"} 
		};
		
		//获取要分组的字段，放入Map中
		if(dateType>0){
			groups.put(groupKey.toString(),"DATE_FORMAT({key},'"+dateFormats[dateType][0]+"')");
		}else{
			groups.put(groupKey.toString(),"{key}");
		}
		if(dateType<6 && dateType>0){ 
			params.put("asc", groupKey.toString()); 
			if(params.get(groupKey.name()+"Start")==null){
				params.put(groupKey.name()+"Start", Utils.date(new Date(), -24, dateFormats[dateType][2]));
			}
		}
		
		
		//获取要统计的字段，放入Map中
		if(sumKey.toString().equals("count")){
			sums.put(sumKey.toString(),"count(*)");
		}else{
			sums.put(sumKey.toString(),"sum({key})");
		}
		
		List<Map> list = getTbPartnersDao().getTbPartnersStats(params,groups,sums);
		
		List<Map> result = new ArrayList();
		for(Map m:list){
			Map map = new HashMap();
			Object value = m.get(sumKey.toString());
			Object name = null;
			Object groupValue = m.get(groupKey.toString());
			if(dateType>0){
				name = Utils.date(Utils.parseDate(groupValue), dateFormats[dateType][1]);
			}else{
				try{
					java.lang.reflect.Method method = TbPartners.class.getMethod("get"+Utils.ForMat(groupKey.toString())+"$");
					method.setAccessible(true);
					name = method.invoke(TbPartners.fromMap(m));
				}catch(Exception ex){
					ex.printStackTrace();
				}
			}
			map.put("name", name);
			map.put("value", value);
			result.add(map);
		}
		return result;
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static int updateTbPartners(Map set,Map where){
		if(set.isEmpty())throw new RuntimeException("set为空");
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		return getTbPartnersDao().updateTbPartnersByConfirm(set, where);
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void deleteTbPartners(Map where){
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		getTbPartnersDao().deleteTbPartnersByConfirm(where);
	}
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void delete(Long id){
		if(id==null)throw new RuntimeException("id为空");
		
		getTbPartnersDao().deleteTbPartnersById(id);
		
	}
	
	
	/**
	 * 保存合伙人信息对象
	 * @param params
	 * @return
	 */
	public TbPartners save(){
		if(this.getTbpId()!=null)
			getTbPartnersDao().updateTbPartners(this);
		else
			return getTbPartnersDao().saveTbPartners(this);
		return this;
	}
	
	
	/**
	 * 更新合伙人信息对象的非空字段,注意跟Service里面的update不一样哦
	 * @param params
	 * @return
	 */
	public int update(){
		return getTbPartnersDao().updateTbPartners$NotNull(this);
	}
	
	
	/**
	 * 删除
	 * @param params
	 * @return
	 */
	public void delete(){
		
			getTbPartnersDao().deleteTbPartnersById(this.getTbpId());
	}
	
	/**
	 * 执行事务
	 * @param function
	 */
	public static <T> T execute(Function function){
		return getTbPartnersDao().executeTransaction(function);
	}

	
	
	/*******************************编号**********************************/	
	/**
	* 编号 [非空]      
	**/
	public Long getTbpId(){
		
		if(this.tbpId!=null){
			return this.tbpId;
		}
		
		return this.tbpId;
	}
	/**
	* 获取编号格式化(toString)
	**/
	public String getTbpId$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpId());
	 
	 	 return strValue;
	}
	/**
	* 根据编号反格式化
	**/
	public void setTbpId$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpId=null;
			return;
		}
	
	
	 	this.tbpId=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 编号 [非空]      
	**/
	public void setTbpId(Long tbpId){
		this.tbpId = tbpId;
		
		this.setSeted(F.tbpId);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************会员名称**********************************/	
	/**
	* 会员名称       
	**/
	public String getNickName(){
		
		if(this.nickName!=null){
			return this.nickName;
		}
		
		Member member = Member.get(this.getTbpMember());
		if(member!=null){
			this.nickName=member.getNickName();
		}
				
		
		return this.nickName;
	}
	/**
	* 获取会员名称格式化(toString)
	**/
	public String getNickName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getNickName());
	 
	 	 return strValue;
	}
	/**
	* 根据会员名称反格式化
	**/
	public void setNickName$(String strValue){
		if(Utils.empty(strValue)){
			this.nickName=null;
			return;
		}
	
	
	 	this.nickName=strValue;
	 
	}
	
	/**
	* 会员名称       
	**/
	public void setNickName(String nickName){
		this.nickName = nickName;
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************会员**********************************/	
	/**
	* 会员  [Member]     
	**/
	public Long getTbpMember(){
		
		if(this.tbpMember!=null){
			return this.tbpMember;
		}
		
		return this.tbpMember;
	}
	/**
	* 获取会员格式化(toString)
	**/
	public String getTbpMember$(){
		String strValue="";
	
	
		 
		if(this.getTbpMember()!=null){
			
				strValue+=Utils.string(Member.getKeyValue(this.getTbpMember()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据会员反格式化
	**/
	public void setTbpMember$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpMember=null;
			return;
		}
	
	
		 
		Member item = Member.find(strValue);
		if(item!=null){
			
			this.tbpMember = Utils.parseLong(item.getUid());
			
		}
		 
	 
	}
	
	/**
	* 会员  [Member]     
	**/
	public void setTbpMember(Long tbpMember){
		this.tbpMember = tbpMember;
		
		this.setSeted(F.tbpMember);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[会员信息]
	**/	 			
 	public Member get$tbpMember(){
 		if(this.$tbpMember!=null)
 			return this.$tbpMember;
 		com.distribute.framework.model.Member member = null;
		if(this.getTbpMember()!=null){
		
 			member = Member.get(this.getTbpMember());
 		
 		}
 		return member;
	}
	
 	
	
	
	/*******************************品牌**********************************/	
	/**
	* 品牌  [Merchant]     
	**/
	public Long getTbpBrand(){
		
		if(this.tbpBrand!=null){
			return this.tbpBrand;
		}
		
		return this.tbpBrand;
	}
	/**
	* 获取品牌格式化(toString)
	**/
	public String getTbpBrand$(){
		String strValue="";
	
	
		 
		if(this.getTbpBrand()!=null){
			
				strValue+=Utils.string(Merchant.getKeyValue(this.getTbpBrand()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据品牌反格式化
	**/
	public void setTbpBrand$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpBrand=null;
			return;
		}
	
	
		 
		Merchant item = Merchant.find(strValue);
		if(item!=null){
			
			this.tbpBrand = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 品牌  [Merchant]     
	**/
	public void setTbpBrand(Long tbpBrand){
		this.tbpBrand = tbpBrand;
		
		this.setSeted(F.tbpBrand);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[品牌信息]
	**/	 			
 	public Merchant get$tbpBrand(){
 		if(this.$tbpBrand!=null)
 			return this.$tbpBrand;
 		com.distribute.framework.model.Merchant merchant = null;
		if(this.getTbpBrand()!=null){
		
 			merchant = Merchant.get(this.getTbpBrand());
 		
 		}
 		return merchant;
	}
	
 	
	
	
	/*******************************姓名**********************************/	
	/**
	* 姓名       
	**/
	public String getTbpName(){
		
		if(this.tbpName!=null){
			return this.tbpName;
		}
		
		return this.tbpName;
	}
	/**
	* 获取姓名格式化(toString)
	**/
	public String getTbpName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpName());
	 
	 	 return strValue;
	}
	/**
	* 根据姓名反格式化
	**/
	public void setTbpName$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpName=null;
			return;
		}
	
	
	 	this.tbpName=strValue;
	 
	}
	
	/**
	* 姓名       
	**/
	public void setTbpName(String tbpName){
		this.tbpName = tbpName;
		
		this.setSeted(F.tbpName);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************手机号**********************************/	
	/**
	* 手机号       
	**/
	public String getTbpMobile(){
		
		if(this.tbpMobile!=null){
			return this.tbpMobile;
		}
		
		return this.tbpMobile;
	}
	/**
	* 获取手机号格式化(toString)
	**/
	public String getTbpMobile$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpMobile());
	 
	 	 return strValue;
	}
	/**
	* 根据手机号反格式化
	**/
	public void setTbpMobile$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpMobile=null;
			return;
		}
	
	
	 	this.tbpMobile=strValue;
	 
	}
	
	/**
	* 手机号       
	**/
	public void setTbpMobile(String tbpMobile){
		this.tbpMobile = tbpMobile;
		
		this.setSeted(F.tbpMobile);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************上级**********************************/	
	/**
	* 上级       
	**/
	public String getTbpTop(){
		
		if(this.tbpTop!=null){
			return this.tbpTop;
		}
		
		return this.tbpTop;
	}
	/**
	* 获取上级格式化(toString)
	**/
	public String getTbpTop$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpTop());
	 
	 	 return strValue;
	}
	/**
	* 根据上级反格式化
	**/
	public void setTbpTop$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpTop=null;
			return;
		}
	
	
	 	this.tbpTop=strValue;
	 
	}
	
	/**
	* 上级       
	**/
	public void setTbpTop(String tbpTop){
		this.tbpTop = tbpTop;
		
		this.setSeted(F.tbpTop);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************上上级**********************************/	
	/**
	* 上上级       
	**/
	public String getTbpToptop(){
		
		if(this.tbpToptop!=null){
			return this.tbpToptop;
		}
		
		return this.tbpToptop;
	}
	/**
	* 获取上上级格式化(toString)
	**/
	public String getTbpToptop$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpToptop());
	 
	 	 return strValue;
	}
	/**
	* 根据上上级反格式化
	**/
	public void setTbpToptop$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpToptop=null;
			return;
		}
	
	
	 	this.tbpToptop=strValue;
	 
	}
	
	/**
	* 上上级       
	**/
	public void setTbpToptop(String tbpToptop){
		this.tbpToptop = tbpToptop;
		
		this.setSeted(F.tbpToptop);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************性别**********************************/	
	/**
	* 性别       
	**/
	public String getTbpSex(){
		
		if(this.tbpSex!=null){
			return this.tbpSex;
		}
		
		return this.tbpSex;
	}
	/**
	* 获取性别格式化(toString)
	**/
	public String getTbpSex$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpSex());
	 
	 	 return strValue;
	}
	/**
	* 根据性别反格式化
	**/
	public void setTbpSex$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpSex=null;
			return;
		}
	
	
	 	this.tbpSex=strValue;
	 
	}
	
	/**
	* 性别       
	**/
	public void setTbpSex(String tbpSex){
		this.tbpSex = tbpSex;
		
		this.setSeted(F.tbpSex);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************年龄**********************************/	
	/**
	* 年龄       
	**/
	public String getTbpAge(){
		
		if(this.tbpAge!=null){
			return this.tbpAge;
		}
		
		return this.tbpAge;
	}
	/**
	* 获取年龄格式化(toString)
	**/
	public String getTbpAge$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpAge());
	 
	 	 return strValue;
	}
	/**
	* 根据年龄反格式化
	**/
	public void setTbpAge$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpAge=null;
			return;
		}
	
	
	 	this.tbpAge=strValue;
	 
	}
	
	/**
	* 年龄       
	**/
	public void setTbpAge(String tbpAge){
		this.tbpAge = tbpAge;
		
		this.setSeted(F.tbpAge);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************收入**********************************/	
	/**
	* 收入       
	**/
	public String getTbpSr(){
		
		if(this.tbpSr!=null){
			return this.tbpSr;
		}
		
		return this.tbpSr;
	}
	/**
	* 获取收入格式化(toString)
	**/
	public String getTbpSr$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpSr());
	 
	 	 return strValue;
	}
	/**
	* 根据收入反格式化
	**/
	public void setTbpSr$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpSr=null;
			return;
		}
	
	
	 	this.tbpSr=strValue;
	 
	}
	
	/**
	* 收入       
	**/
	public void setTbpSr(String tbpSr){
		this.tbpSr = tbpSr;
		
		this.setSeted(F.tbpSr);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************职业**********************************/	
	/**
	* 职业       
	**/
	public String getTbpZy(){
		
		if(this.tbpZy!=null){
			return this.tbpZy;
		}
		
		return this.tbpZy;
	}
	/**
	* 获取职业格式化(toString)
	**/
	public String getTbpZy$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpZy());
	 
	 	 return strValue;
	}
	/**
	* 根据职业反格式化
	**/
	public void setTbpZy$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpZy=null;
			return;
		}
	
	
	 	this.tbpZy=strValue;
	 
	}
	
	/**
	* 职业       
	**/
	public void setTbpZy(String tbpZy){
		this.tbpZy = tbpZy;
		
		this.setSeted(F.tbpZy);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************全称**********************************/	
	/**
	* 全称       
	**/
	public String getTbpFullName(){
		
		if(this.tbpFullName!=null){
			return this.tbpFullName;
		}
		
		return this.tbpFullName;
	}
	/**
	* 获取全称格式化(toString)
	**/
	public String getTbpFullName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpFullName());
	 
	 	 return strValue;
	}
	/**
	* 根据全称反格式化
	**/
	public void setTbpFullName$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpFullName=null;
			return;
		}
	
	
		this.tbpFullName=strValue;
	 
	}
	
	/**
	* 全称       
	**/
	public void setTbpFullName(String tbpFullName){
		this.tbpFullName = tbpFullName;
		
		this.setSeted(F.tbpFullName);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************街道地址**********************************/	
	/**
	* 街道地址  [Region]     
	**/
	public Long getTbpJiedao(){
		
		if(this.tbpJiedao!=null){
			return this.tbpJiedao;
		}
		
		return this.tbpJiedao;
	}
	/**
	* 获取街道地址格式化(toString)
	**/
	public String getTbpJiedao$(){
		String strValue="";
	
	
		 
		if(this.getTbpJiedao()!=null){
			
				strValue+=Utils.string(Region.getKeyValue(this.getTbpJiedao()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据街道地址反格式化
	**/
	public void setTbpJiedao$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpJiedao=null;
			return;
		}
	
	
		 
		Region item = Region.find(strValue);
		if(item!=null){
			
			this.tbpJiedao = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 街道地址  [Region]     
	**/
	public void setTbpJiedao(Long tbpJiedao){
		this.tbpJiedao = tbpJiedao;
		
		this.setSeted(F.tbpJiedao);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[省市地区]
	**/	 			
 	public Region get$tbpJiedao(){
 		if(this.$tbpJiedao!=null)
 			return this.$tbpJiedao;
 		com.distribute.framework.model.Region region = null;
		if(this.getTbpJiedao()!=null){
		
 			region = Region.get(this.getTbpJiedao());
 		
 		}
 		return region;
	}
	
 	
	
	
	/*******************************审核理由**********************************/	
	/**
	* 审核理由       
	**/
	public String getTbpLiyou(){
		
		if(this.tbpLiyou!=null){
			return this.tbpLiyou;
		}
		
		return this.tbpLiyou;
	}
	/**
	* 获取审核理由格式化(toString)
	**/
	public String getTbpLiyou$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpLiyou());
	 
	 	 return strValue;
	}
	/**
	* 根据审核理由反格式化
	**/
	public void setTbpLiyou$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpLiyou=null;
			return;
		}
	
	
		this.tbpLiyou=strValue;
	 
	}
	
	/**
	* 审核理由       
	**/
	public void setTbpLiyou(String tbpLiyou){
		this.tbpLiyou = tbpLiyou;
		
		this.setSeted(F.tbpLiyou);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************经度**********************************/	
	/**
	* 经度       
	**/
	public String getTbpLongitude(){
		
		if(this.tbpLongitude!=null){
			return this.tbpLongitude;
		}
		
		return this.tbpLongitude;
	}
	/**
	* 获取经度格式化(toString)
	**/
	public String getTbpLongitude$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpLongitude());
	 
	 	 return strValue;
	}
	/**
	* 根据经度反格式化
	**/
	public void setTbpLongitude$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpLongitude=null;
			return;
		}
	
	
	 	this.tbpLongitude=strValue;
	 
	}
	
	/**
	* 经度       
	**/
	public void setTbpLongitude(String tbpLongitude){
		this.tbpLongitude = tbpLongitude;
		
		this.setSeted(F.tbpLongitude);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************纬度**********************************/	
	/**
	* 纬度       
	**/
	public String getTbpLatitude(){
		
		if(this.tbpLatitude!=null){
			return this.tbpLatitude;
		}
		
		return this.tbpLatitude;
	}
	/**
	* 获取纬度格式化(toString)
	**/
	public String getTbpLatitude$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpLatitude());
	 
	 	 return strValue;
	}
	/**
	* 根据纬度反格式化
	**/
	public void setTbpLatitude$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpLatitude=null;
			return;
		}
	
	
	 	this.tbpLatitude=strValue;
	 
	}
	
	/**
	* 纬度       
	**/
	public void setTbpLatitude(String tbpLatitude){
		this.tbpLatitude = tbpLatitude;
		
		this.setSeted(F.tbpLatitude);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************省**********************************/	
	/**
	* 省       
	**/
	public Long getTbpProvince(){
		
		if(this.tbpProvince!=null){
			return this.tbpProvince;
		}
		
		return this.tbpProvince;
	}
	/**
	* 获取省格式化(toString)
	**/
	public String getTbpProvince$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpProvince());
	 
	 	 return strValue;
	}
	/**
	* 根据省反格式化
	**/
	public void setTbpProvince$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpProvince=null;
			return;
		}
	
	
	 	this.tbpProvince=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 省       
	**/
	public void setTbpProvince(Long tbpProvince){
		this.tbpProvince = tbpProvince;
		
		this.setSeted(F.tbpProvince);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************市**********************************/	
	/**
	* 市       
	**/
	public Long getTbpCity(){
		
		if(this.tbpCity!=null){
			return this.tbpCity;
		}
		
		return this.tbpCity;
	}
	/**
	* 获取市格式化(toString)
	**/
	public String getTbpCity$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpCity());
	 
	 	 return strValue;
	}
	/**
	* 根据市反格式化
	**/
	public void setTbpCity$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpCity=null;
			return;
		}
	
	
	 	this.tbpCity=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 市       
	**/
	public void setTbpCity(Long tbpCity){
		this.tbpCity = tbpCity;
		
		this.setSeted(F.tbpCity);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************县**********************************/	
	/**
	* 县       
	**/
	public Long getTbpCounty(){
		
		if(this.tbpCounty!=null){
			return this.tbpCounty;
		}
		
		return this.tbpCounty;
	}
	/**
	* 获取县格式化(toString)
	**/
	public String getTbpCounty$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbpCounty());
	 
	 	 return strValue;
	}
	/**
	* 根据县反格式化
	**/
	public void setTbpCounty$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpCounty=null;
			return;
		}
	
	
	 	this.tbpCounty=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 县       
	**/
	public void setTbpCounty(Long tbpCounty){
		this.tbpCounty = tbpCounty;
		
		this.setSeted(F.tbpCounty);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************申请时间**********************************/	
	/**
	* 申请时间       
	**/
	public Date getTbpTime(){
		
		if(this.tbpTime!=null){
			return this.tbpTime;
		}
		
		return this.tbpTime;
	}
	/**
	* 获取申请时间格式化(toString)
	**/
	public String getTbpTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getTbpTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据申请时间反格式化
	**/
	public void setTbpTime$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpTime=null;
			return;
		}
	
	
	 	this.tbpTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 申请时间       
	**/
	public void setTbpTime(Date tbpTime){
		this.tbpTime = tbpTime;
		
		this.setSeted(F.tbpTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************是否购买卡**********************************/	
	/**
	* 是否购买卡    1:未购买 2:已购买    
	**/
	public Short getTbpPayCard(){
		
		if(this.tbpPayCard!=null){
			return this.tbpPayCard;
		}
		
		return this.tbpPayCard;
	}
	/**
	* 获取是否购买卡格式化(toString)
	**/
	public String getTbpPayCard$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getTbpPayCard()),"1"))
			strValue=Utils.string("未购买");		 
			
		 if(Utils.equals(Utils.string(this.getTbpPayCard()),"2"))
			strValue=Utils.string("已购买");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据是否购买卡反格式化
	**/
	public void setTbpPayCard$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpPayCard=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"未购买"))
		 	this.tbpPayCard=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"已购买"))
		 	this.tbpPayCard=Utils.parseShort("2");
			
		
	 
	}
	
	/**
	* 是否购买卡    1:未购买 2:已购买    
	**/
	public void setTbpPayCard(Short tbpPayCard){
		this.tbpPayCard = tbpPayCard;
		
		this.setSeted(F.tbpPayCard);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************审核状态**********************************/	
	/**
	* 审核状态    1:待处理 2:通过 3:不通过    
	**/
	public Short getTbpAuth(){
		
		if(this.tbpAuth!=null){
			return this.tbpAuth;
		}
		
		return this.tbpAuth;
	}
	/**
	* 获取审核状态格式化(toString)
	**/
	public String getTbpAuth$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getTbpAuth()),"1"))
			strValue=Utils.string("待处理");		 
			
		 if(Utils.equals(Utils.string(this.getTbpAuth()),"2"))
			strValue=Utils.string("通过");		 
			
		 if(Utils.equals(Utils.string(this.getTbpAuth()),"3"))
			strValue=Utils.string("不通过");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据审核状态反格式化
	**/
	public void setTbpAuth$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpAuth=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"待处理"))
		 	this.tbpAuth=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"通过"))
		 	this.tbpAuth=Utils.parseShort("2");
			
		 if(Utils.equals(strValue,"不通过"))
		 	this.tbpAuth=Utils.parseShort("3");
			
		
	 
	}
	
	/**
	* 审核状态    1:待处理 2:通过 3:不通过    
	**/
	public void setTbpAuth(Short tbpAuth){
		this.tbpAuth = tbpAuth;
		
		this.setSeted(F.tbpAuth);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************添加时间**********************************/	
	/**
	* 添加时间       
	**/
	public Date getTbpAddTime(){
		
		if(this.tbpAddTime!=null){
			return this.tbpAddTime;
		}
		
		return this.tbpAddTime;
	}
	/**
	* 获取添加时间格式化(toString)
	**/
	public String getTbpAddTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getTbpAddTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据添加时间反格式化
	**/
	public void setTbpAddTime$(String strValue){
		if(Utils.empty(strValue)){
			this.tbpAddTime=null;
			return;
		}
	
	
	 	this.tbpAddTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 添加时间       
	**/
	public void setTbpAddTime(Date tbpAddTime){
		this.tbpAddTime = tbpAddTime;
		
		this.setSeted(F.tbpAddTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	
	/************LAZY3Q_DEFINE_CODE************/
	/************LAZY3Q_DEFINE_CODE************/	
	
	
	/**
	 * 触发器
	 */
	public static void on(Trigger.Index index,final Notify.Listener listener,Trigger.Type... types){
		Notify.on(TbPartners.class, index, listener, types);
	}
	public static void on(final Notify.Listener listener,String type){
		Notify.on(TbPartners.class, listener, type);
	}
	/**
	 * 当修改字段时
	 * @param filedName
	 * @param listener
	 */
	public static void on(String filedName,final Notify.Listener listener){
		Notify.on(TbPartners.class, listener, filedName);
	}
	/**
	 * 当修改字段为某值时
	 * @param filedName
	 * @param value
	 * @param listener
	 */
	public static void on(String filedName,Object value,final Notify.Listener listener){
		if(value==null)return;
		Notify.on(TbPartners.class, listener, filedName+"."+Utils.md5(""+value));
	}
	public void notify(String type){
		Trigger.on(TbPartners.class,type, this);
	}
	
	
	/**
	 * 用来获取当有字段关联对象时的获取方式,调用如${TbPartners.obj.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${TbPartners.$filedName}获取关联对象
	 */
	public Map getObj(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return TbPartners.class.getMethod("get$"+Utils.forMat(key.toString())).invoke(TbPartners.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 用来获取某字段格式化的获取方式,调用如${TbPartners.fmt.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${TbPartners.filedName$}获取某字段格式化
	 */
	public Map getFmt(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return TbPartners.class.getMethod("get"+Utils.ForMat(key.toString()+"$")).invoke(TbPartners.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 获取查询参数链式串
	 * @return
	 */
	public static @Deprecated M where(){ return new M(0); }
	public static @Deprecated M m(){ return new M(0); }
	public static M where = new M(0,true);
	public static @database(DatabaseNames.distribute_sys) class M extends IbatisMap{
		int type = 0; 
		M linked = null;
		Boolean proxy = false;
		public M set = null;
		public M(int type){
			this.type = type;
			if(this.type==0){
				set = new M(1,true);
				set.linked = this;
			}
		};
		public M(int type,Boolean proxy){
			this.type = type;
			this.proxy=proxy;
		};
		public M proxy(){
			M m = new M(this.type);//当前的对像
			if(this.type==0){
				m.set = new M(1,true);//set对象
				m.set.linked = m;
			}else{
				m.linked=this.linked;
				this.linked.linked=m;
			}
			return m;
		}
		public @Deprecated M set(){			
			M m = this;
			m.linked=new M(1);
			m.linked.linked=m;
			return m.linked;
		};
		
		public M on(IbatisMap value,C column,String joinColumn){if(proxy)return proxy().on(value,column,joinColumn);this.put(value.getClass().getDeclaringClass().getSimpleName(), value);value.put("on", column.toString());value.put("to", joinColumn);return this;};
		
		
			
		
		/** 编号 [非空]       **/
		public M tbpId(Object tbpId){if(proxy)return proxy().tbpId(tbpId);  this.put("tbpId", tbpId);return this;};
	 	/** and tbp_id is null */
 		public M tbpIdNull(){if(proxy)return proxy().tbpIdNull();if(this.get("tbpIdNot")==null)this.put("tbpIdNot", "");this.put("tbpId", null);return this;};
 		/** not .... */
 		public M tbpIdNot(){if(proxy)return proxy().tbpIdNot();this.put("tbpIdNot", "not");return this;};
 		public M tbpIdNotNull(){if(proxy)return proxy().tbpIdNotNull();this.put("tbpIdNot", "not");this.put("tbpId", null);return this;};
 		public M tbpIdNot(Object tbpId){if(proxy)return proxy().tbpIdNot(tbpId);this.put("tbpIdNot", "not");this.put("tbpId", tbpId);return this;};
	 		
		/** and tbp_id <= ? */
		public M tbpIdMin(Object min){if(proxy)return proxy().tbpIdMin(min);this.put("tbpIdMin", min);return this;};
		/** and tbp_id >= ? */
		public M tbpIdMax(Object max){if(proxy)return proxy().tbpIdMax(max);this.put("tbpIdMax", max);return this;};
			
			
		public M tbpIdIn(String ids){
			if(proxy)return proxy().tbpIdIn(ids);  this.put("tbpIdIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 会员名称        **/
		public M nickName(Object nickName){if(proxy)return proxy().nickName(nickName);  this.put("nickName", nickName);return this;};
	 	/** and nick_name is null */
 		public M nickNameNull(){if(proxy)return proxy().nickNameNull();if(this.get("nickNameNot")==null)this.put("nickNameNot", "");this.put("nickName", null);return this;};
 		/** not .... */
 		public M nickNameNot(){if(proxy)return proxy().nickNameNot();this.put("nickNameNot", "not");return this;};
 		public M nickNameNotNull(){if(proxy)return proxy().nickNameNotNull();this.put("nickNameNot", "not");this.put("nickName", null);return this;};
 		public M nickNameNot(Object nickName){if(proxy)return proxy().nickNameNot(nickName);this.put("nickNameNot", "not");this.put("nickName", nickName);return this;};
	 		
			
		
			
	 	
			
		public M tbpMember$on(Member.M value){if(proxy)return proxy().tbpMember$on(value);this.put("TbpMember", value);value.put("on", "tbp_member");return this;};
 				
 			
		
		/** 会员  [Member]      **/
		public M tbpMember(Object tbpMember){if(proxy)return proxy().tbpMember(tbpMember);  this.put("tbpMember", tbpMember);return this;};
	 	/** and tbp_member is null */
 		public M tbpMemberNull(){if(proxy)return proxy().tbpMemberNull();if(this.get("tbpMemberNot")==null)this.put("tbpMemberNot", "");this.put("tbpMember", null);return this;};
 		/** not .... */
 		public M tbpMemberNot(){if(proxy)return proxy().tbpMemberNot();this.put("tbpMemberNot", "not");return this;};
 		public M tbpMemberNotNull(){if(proxy)return proxy().tbpMemberNotNull();this.put("tbpMemberNot", "not");this.put("tbpMember", null);return this;};
 		public M tbpMemberNot(Object tbpMember){if(proxy)return proxy().tbpMemberNot(tbpMember);this.put("tbpMemberNot", "not");this.put("tbpMember", tbpMember);return this;};
	 		
			
		public M tbpMemberIn(String ids){
			if(proxy)return proxy().tbpMemberIn(ids);  this.put("tbpMemberIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M tbpBrand$on(Merchant.M value){if(proxy)return proxy().tbpBrand$on(value);this.put("TbpBrand", value);value.put("on", "tbp_brand");return this;};
 				
 			
		
		/** 品牌  [Merchant]      **/
		public M tbpBrand(Object tbpBrand){if(proxy)return proxy().tbpBrand(tbpBrand);  this.put("tbpBrand", tbpBrand);return this;};
	 	/** and tbp_brand is null */
 		public M tbpBrandNull(){if(proxy)return proxy().tbpBrandNull();if(this.get("tbpBrandNot")==null)this.put("tbpBrandNot", "");this.put("tbpBrand", null);return this;};
 		/** not .... */
 		public M tbpBrandNot(){if(proxy)return proxy().tbpBrandNot();this.put("tbpBrandNot", "not");return this;};
 		public M tbpBrandNotNull(){if(proxy)return proxy().tbpBrandNotNull();this.put("tbpBrandNot", "not");this.put("tbpBrand", null);return this;};
 		public M tbpBrandNot(Object tbpBrand){if(proxy)return proxy().tbpBrandNot(tbpBrand);this.put("tbpBrandNot", "not");this.put("tbpBrand", tbpBrand);return this;};
	 		
			
		public M tbpBrandIn(String ids){
			if(proxy)return proxy().tbpBrandIn(ids);  this.put("tbpBrandIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 姓名        **/
		public M tbpName(Object tbpName){if(proxy)return proxy().tbpName(tbpName);  this.put("tbpName", tbpName);return this;};
	 	/** and tbp_name is null */
 		public M tbpNameNull(){if(proxy)return proxy().tbpNameNull();if(this.get("tbpNameNot")==null)this.put("tbpNameNot", "");this.put("tbpName", null);return this;};
 		/** not .... */
 		public M tbpNameNot(){if(proxy)return proxy().tbpNameNot();this.put("tbpNameNot", "not");return this;};
 		public M tbpNameNotNull(){if(proxy)return proxy().tbpNameNotNull();this.put("tbpNameNot", "not");this.put("tbpName", null);return this;};
 		public M tbpNameNot(Object tbpName){if(proxy)return proxy().tbpNameNot(tbpName);this.put("tbpNameNot", "not");this.put("tbpName", tbpName);return this;};
	 		
			
		
			
	 	
			
		
		/** 手机号        **/
		public M tbpMobile(Object tbpMobile){if(proxy)return proxy().tbpMobile(tbpMobile);  this.put("tbpMobile", tbpMobile);return this;};
	 	/** and tbp_mobile is null */
 		public M tbpMobileNull(){if(proxy)return proxy().tbpMobileNull();if(this.get("tbpMobileNot")==null)this.put("tbpMobileNot", "");this.put("tbpMobile", null);return this;};
 		/** not .... */
 		public M tbpMobileNot(){if(proxy)return proxy().tbpMobileNot();this.put("tbpMobileNot", "not");return this;};
 		public M tbpMobileNotNull(){if(proxy)return proxy().tbpMobileNotNull();this.put("tbpMobileNot", "not");this.put("tbpMobile", null);return this;};
 		public M tbpMobileNot(Object tbpMobile){if(proxy)return proxy().tbpMobileNot(tbpMobile);this.put("tbpMobileNot", "not");this.put("tbpMobile", tbpMobile);return this;};
	 		
			
		
			
	 	
			
		
		/** 上级        **/
		public M tbpTop(Object tbpTop){if(proxy)return proxy().tbpTop(tbpTop);  this.put("tbpTop", tbpTop);return this;};
	 	/** and tbp_top is null */
 		public M tbpTopNull(){if(proxy)return proxy().tbpTopNull();if(this.get("tbpTopNot")==null)this.put("tbpTopNot", "");this.put("tbpTop", null);return this;};
 		/** not .... */
 		public M tbpTopNot(){if(proxy)return proxy().tbpTopNot();this.put("tbpTopNot", "not");return this;};
 		public M tbpTopNotNull(){if(proxy)return proxy().tbpTopNotNull();this.put("tbpTopNot", "not");this.put("tbpTop", null);return this;};
 		public M tbpTopNot(Object tbpTop){if(proxy)return proxy().tbpTopNot(tbpTop);this.put("tbpTopNot", "not");this.put("tbpTop", tbpTop);return this;};
	 		
			
		
			
	 	
			
		
		/** 上上级        **/
		public M tbpToptop(Object tbpToptop){if(proxy)return proxy().tbpToptop(tbpToptop);  this.put("tbpToptop", tbpToptop);return this;};
	 	/** and tbp_toptop is null */
 		public M tbpToptopNull(){if(proxy)return proxy().tbpToptopNull();if(this.get("tbpToptopNot")==null)this.put("tbpToptopNot", "");this.put("tbpToptop", null);return this;};
 		/** not .... */
 		public M tbpToptopNot(){if(proxy)return proxy().tbpToptopNot();this.put("tbpToptopNot", "not");return this;};
 		public M tbpToptopNotNull(){if(proxy)return proxy().tbpToptopNotNull();this.put("tbpToptopNot", "not");this.put("tbpToptop", null);return this;};
 		public M tbpToptopNot(Object tbpToptop){if(proxy)return proxy().tbpToptopNot(tbpToptop);this.put("tbpToptopNot", "not");this.put("tbpToptop", tbpToptop);return this;};
	 		
			
		
			
	 	
			
		
		/** 性别        **/
		public M tbpSex(Object tbpSex){if(proxy)return proxy().tbpSex(tbpSex);  this.put("tbpSex", tbpSex);return this;};
	 	/** and tbp_sex is null */
 		public M tbpSexNull(){if(proxy)return proxy().tbpSexNull();if(this.get("tbpSexNot")==null)this.put("tbpSexNot", "");this.put("tbpSex", null);return this;};
 		/** not .... */
 		public M tbpSexNot(){if(proxy)return proxy().tbpSexNot();this.put("tbpSexNot", "not");return this;};
 		public M tbpSexNotNull(){if(proxy)return proxy().tbpSexNotNull();this.put("tbpSexNot", "not");this.put("tbpSex", null);return this;};
 		public M tbpSexNot(Object tbpSex){if(proxy)return proxy().tbpSexNot(tbpSex);this.put("tbpSexNot", "not");this.put("tbpSex", tbpSex);return this;};
	 		
			
		
			
	 	
			
		
		/** 年龄        **/
		public M tbpAge(Object tbpAge){if(proxy)return proxy().tbpAge(tbpAge);  this.put("tbpAge", tbpAge);return this;};
	 	/** and tbp_age is null */
 		public M tbpAgeNull(){if(proxy)return proxy().tbpAgeNull();if(this.get("tbpAgeNot")==null)this.put("tbpAgeNot", "");this.put("tbpAge", null);return this;};
 		/** not .... */
 		public M tbpAgeNot(){if(proxy)return proxy().tbpAgeNot();this.put("tbpAgeNot", "not");return this;};
 		public M tbpAgeNotNull(){if(proxy)return proxy().tbpAgeNotNull();this.put("tbpAgeNot", "not");this.put("tbpAge", null);return this;};
 		public M tbpAgeNot(Object tbpAge){if(proxy)return proxy().tbpAgeNot(tbpAge);this.put("tbpAgeNot", "not");this.put("tbpAge", tbpAge);return this;};
	 		
			
		
			
	 	
			
		
		/** 收入        **/
		public M tbpSr(Object tbpSr){if(proxy)return proxy().tbpSr(tbpSr);  this.put("tbpSr", tbpSr);return this;};
	 	/** and tbp_sr is null */
 		public M tbpSrNull(){if(proxy)return proxy().tbpSrNull();if(this.get("tbpSrNot")==null)this.put("tbpSrNot", "");this.put("tbpSr", null);return this;};
 		/** not .... */
 		public M tbpSrNot(){if(proxy)return proxy().tbpSrNot();this.put("tbpSrNot", "not");return this;};
 		public M tbpSrNotNull(){if(proxy)return proxy().tbpSrNotNull();this.put("tbpSrNot", "not");this.put("tbpSr", null);return this;};
 		public M tbpSrNot(Object tbpSr){if(proxy)return proxy().tbpSrNot(tbpSr);this.put("tbpSrNot", "not");this.put("tbpSr", tbpSr);return this;};
	 		
			
		
			
	 	
			
		
		/** 职业        **/
		public M tbpZy(Object tbpZy){if(proxy)return proxy().tbpZy(tbpZy);  this.put("tbpZy", tbpZy);return this;};
	 	/** and tbp_zy is null */
 		public M tbpZyNull(){if(proxy)return proxy().tbpZyNull();if(this.get("tbpZyNot")==null)this.put("tbpZyNot", "");this.put("tbpZy", null);return this;};
 		/** not .... */
 		public M tbpZyNot(){if(proxy)return proxy().tbpZyNot();this.put("tbpZyNot", "not");return this;};
 		public M tbpZyNotNull(){if(proxy)return proxy().tbpZyNotNull();this.put("tbpZyNot", "not");this.put("tbpZy", null);return this;};
 		public M tbpZyNot(Object tbpZy){if(proxy)return proxy().tbpZyNot(tbpZy);this.put("tbpZyNot", "not");this.put("tbpZy", tbpZy);return this;};
	 		
			
		
			
	 	
			
		
		/** 全称        **/
		public M tbpFullName(Object tbpFullName){if(proxy)return proxy().tbpFullName(tbpFullName);  this.put("tbpFullName", tbpFullName);return this;};
	 	/** and tbp_full_name is null */
 		public M tbpFullNameNull(){if(proxy)return proxy().tbpFullNameNull();if(this.get("tbpFullNameNot")==null)this.put("tbpFullNameNot", "");this.put("tbpFullName", null);return this;};
 		/** not .... */
 		public M tbpFullNameNot(){if(proxy)return proxy().tbpFullNameNot();this.put("tbpFullNameNot", "not");return this;};
 		public M tbpFullNameNotNull(){if(proxy)return proxy().tbpFullNameNotNull();this.put("tbpFullNameNot", "not");this.put("tbpFullName", null);return this;};
 		public M tbpFullNameNot(Object tbpFullName){if(proxy)return proxy().tbpFullNameNot(tbpFullName);this.put("tbpFullNameNot", "not");this.put("tbpFullName", tbpFullName);return this;};
	 		
			
		
			
	 	
			
		public M tbpJiedao$on(Region.M value){if(proxy)return proxy().tbpJiedao$on(value);this.put("TbpJiedao", value);value.put("on", "tbp_jiedao");return this;};
 				
 			
		
		/** 街道地址  [Region]      **/
		public M tbpJiedao(Object tbpJiedao){if(proxy)return proxy().tbpJiedao(tbpJiedao);  this.put("tbpJiedao", tbpJiedao);return this;};
	 	/** and tbp_jiedao is null */
 		public M tbpJiedaoNull(){if(proxy)return proxy().tbpJiedaoNull();if(this.get("tbpJiedaoNot")==null)this.put("tbpJiedaoNot", "");this.put("tbpJiedao", null);return this;};
 		/** not .... */
 		public M tbpJiedaoNot(){if(proxy)return proxy().tbpJiedaoNot();this.put("tbpJiedaoNot", "not");return this;};
 		public M tbpJiedaoNotNull(){if(proxy)return proxy().tbpJiedaoNotNull();this.put("tbpJiedaoNot", "not");this.put("tbpJiedao", null);return this;};
 		public M tbpJiedaoNot(Object tbpJiedao){if(proxy)return proxy().tbpJiedaoNot(tbpJiedao);this.put("tbpJiedaoNot", "not");this.put("tbpJiedao", tbpJiedao);return this;};
	 		
			
		public M tbpJiedaoIn(String ids){
			if(proxy)return proxy().tbpJiedaoIn(ids);  this.put("tbpJiedaoIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 审核理由        **/
		public M tbpLiyou(Object tbpLiyou){if(proxy)return proxy().tbpLiyou(tbpLiyou);  this.put("tbpLiyou", tbpLiyou);return this;};
	 	/** and tbp_liyou is null */
 		public M tbpLiyouNull(){if(proxy)return proxy().tbpLiyouNull();if(this.get("tbpLiyouNot")==null)this.put("tbpLiyouNot", "");this.put("tbpLiyou", null);return this;};
 		/** not .... */
 		public M tbpLiyouNot(){if(proxy)return proxy().tbpLiyouNot();this.put("tbpLiyouNot", "not");return this;};
 		public M tbpLiyouNotNull(){if(proxy)return proxy().tbpLiyouNotNull();this.put("tbpLiyouNot", "not");this.put("tbpLiyou", null);return this;};
 		public M tbpLiyouNot(Object tbpLiyou){if(proxy)return proxy().tbpLiyouNot(tbpLiyou);this.put("tbpLiyouNot", "not");this.put("tbpLiyou", tbpLiyou);return this;};
	 		
			
		
			
	 	
			
		
		/** 经度        **/
		public M tbpLongitude(Object tbpLongitude){if(proxy)return proxy().tbpLongitude(tbpLongitude);  this.put("tbpLongitude", tbpLongitude);return this;};
	 	/** and tbp_longitude is null */
 		public M tbpLongitudeNull(){if(proxy)return proxy().tbpLongitudeNull();if(this.get("tbpLongitudeNot")==null)this.put("tbpLongitudeNot", "");this.put("tbpLongitude", null);return this;};
 		/** not .... */
 		public M tbpLongitudeNot(){if(proxy)return proxy().tbpLongitudeNot();this.put("tbpLongitudeNot", "not");return this;};
 		public M tbpLongitudeNotNull(){if(proxy)return proxy().tbpLongitudeNotNull();this.put("tbpLongitudeNot", "not");this.put("tbpLongitude", null);return this;};
 		public M tbpLongitudeNot(Object tbpLongitude){if(proxy)return proxy().tbpLongitudeNot(tbpLongitude);this.put("tbpLongitudeNot", "not");this.put("tbpLongitude", tbpLongitude);return this;};
	 		
			
		
			
	 	
			
		
		/** 纬度        **/
		public M tbpLatitude(Object tbpLatitude){if(proxy)return proxy().tbpLatitude(tbpLatitude);  this.put("tbpLatitude", tbpLatitude);return this;};
	 	/** and tbp_latitude is null */
 		public M tbpLatitudeNull(){if(proxy)return proxy().tbpLatitudeNull();if(this.get("tbpLatitudeNot")==null)this.put("tbpLatitudeNot", "");this.put("tbpLatitude", null);return this;};
 		/** not .... */
 		public M tbpLatitudeNot(){if(proxy)return proxy().tbpLatitudeNot();this.put("tbpLatitudeNot", "not");return this;};
 		public M tbpLatitudeNotNull(){if(proxy)return proxy().tbpLatitudeNotNull();this.put("tbpLatitudeNot", "not");this.put("tbpLatitude", null);return this;};
 		public M tbpLatitudeNot(Object tbpLatitude){if(proxy)return proxy().tbpLatitudeNot(tbpLatitude);this.put("tbpLatitudeNot", "not");this.put("tbpLatitude", tbpLatitude);return this;};
	 		
			
		
			
	 	
			
		
		/** 省        **/
		public M tbpProvince(Object tbpProvince){if(proxy)return proxy().tbpProvince(tbpProvince);  this.put("tbpProvince", tbpProvince);return this;};
	 	/** and tbp_province is null */
 		public M tbpProvinceNull(){if(proxy)return proxy().tbpProvinceNull();if(this.get("tbpProvinceNot")==null)this.put("tbpProvinceNot", "");this.put("tbpProvince", null);return this;};
 		/** not .... */
 		public M tbpProvinceNot(){if(proxy)return proxy().tbpProvinceNot();this.put("tbpProvinceNot", "not");return this;};
 		public M tbpProvinceNotNull(){if(proxy)return proxy().tbpProvinceNotNull();this.put("tbpProvinceNot", "not");this.put("tbpProvince", null);return this;};
 		public M tbpProvinceNot(Object tbpProvince){if(proxy)return proxy().tbpProvinceNot(tbpProvince);this.put("tbpProvinceNot", "not");this.put("tbpProvince", tbpProvince);return this;};
	 		
		/** and tbp_province <= ? */
		public M tbpProvinceMin(Object min){if(proxy)return proxy().tbpProvinceMin(min);this.put("tbpProvinceMin", min);return this;};
		/** and tbp_province >= ? */
		public M tbpProvinceMax(Object max){if(proxy)return proxy().tbpProvinceMax(max);this.put("tbpProvinceMax", max);return this;};
			
			
		public M tbpProvinceIn(String ids){
			if(proxy)return proxy().tbpProvinceIn(ids);  this.put("tbpProvinceIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 市        **/
		public M tbpCity(Object tbpCity){if(proxy)return proxy().tbpCity(tbpCity);  this.put("tbpCity", tbpCity);return this;};
	 	/** and tbp_city is null */
 		public M tbpCityNull(){if(proxy)return proxy().tbpCityNull();if(this.get("tbpCityNot")==null)this.put("tbpCityNot", "");this.put("tbpCity", null);return this;};
 		/** not .... */
 		public M tbpCityNot(){if(proxy)return proxy().tbpCityNot();this.put("tbpCityNot", "not");return this;};
 		public M tbpCityNotNull(){if(proxy)return proxy().tbpCityNotNull();this.put("tbpCityNot", "not");this.put("tbpCity", null);return this;};
 		public M tbpCityNot(Object tbpCity){if(proxy)return proxy().tbpCityNot(tbpCity);this.put("tbpCityNot", "not");this.put("tbpCity", tbpCity);return this;};
	 		
		/** and tbp_city <= ? */
		public M tbpCityMin(Object min){if(proxy)return proxy().tbpCityMin(min);this.put("tbpCityMin", min);return this;};
		/** and tbp_city >= ? */
		public M tbpCityMax(Object max){if(proxy)return proxy().tbpCityMax(max);this.put("tbpCityMax", max);return this;};
			
			
		public M tbpCityIn(String ids){
			if(proxy)return proxy().tbpCityIn(ids);  this.put("tbpCityIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 县        **/
		public M tbpCounty(Object tbpCounty){if(proxy)return proxy().tbpCounty(tbpCounty);  this.put("tbpCounty", tbpCounty);return this;};
	 	/** and tbp_county is null */
 		public M tbpCountyNull(){if(proxy)return proxy().tbpCountyNull();if(this.get("tbpCountyNot")==null)this.put("tbpCountyNot", "");this.put("tbpCounty", null);return this;};
 		/** not .... */
 		public M tbpCountyNot(){if(proxy)return proxy().tbpCountyNot();this.put("tbpCountyNot", "not");return this;};
 		public M tbpCountyNotNull(){if(proxy)return proxy().tbpCountyNotNull();this.put("tbpCountyNot", "not");this.put("tbpCounty", null);return this;};
 		public M tbpCountyNot(Object tbpCounty){if(proxy)return proxy().tbpCountyNot(tbpCounty);this.put("tbpCountyNot", "not");this.put("tbpCounty", tbpCounty);return this;};
	 		
		/** and tbp_county <= ? */
		public M tbpCountyMin(Object min){if(proxy)return proxy().tbpCountyMin(min);this.put("tbpCountyMin", min);return this;};
		/** and tbp_county >= ? */
		public M tbpCountyMax(Object max){if(proxy)return proxy().tbpCountyMax(max);this.put("tbpCountyMax", max);return this;};
			
			
		public M tbpCountyIn(String ids){
			if(proxy)return proxy().tbpCountyIn(ids);  this.put("tbpCountyIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 申请时间        **/
		public M tbpTime(Object tbpTime){if(proxy)return proxy().tbpTime(tbpTime);  this.put("tbpTime", tbpTime);return this;};
	 	/** and tbp_time is null */
 		public M tbpTimeNull(){if(proxy)return proxy().tbpTimeNull();if(this.get("tbpTimeNot")==null)this.put("tbpTimeNot", "");this.put("tbpTime", null);return this;};
 		/** not .... */
 		public M tbpTimeNot(){if(proxy)return proxy().tbpTimeNot();this.put("tbpTimeNot", "not");return this;};
 		public M tbpTimeNotNull(){if(proxy)return proxy().tbpTimeNotNull();this.put("tbpTimeNot", "not");this.put("tbpTime", null);return this;};
 		public M tbpTimeNot(Object tbpTime){if(proxy)return proxy().tbpTimeNot(tbpTime);this.put("tbpTimeNot", "not");this.put("tbpTime", tbpTime);return this;};
	 		
 		/** and tbp_time >= ? */
 		public M tbpTimeStart(Object start){if(proxy)return proxy().tbpTimeStart(start);this.put("tbpTimeStart", start);return this;};			
 		/** and tbp_time <= ? */
 		public M tbpTimeEnd(Object end){if(proxy)return proxy().tbpTimeEnd(end);this.put("tbpTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 是否购买卡    1:未购买 2:已购买     **/
		public M tbpPayCard(Object tbpPayCard){if(proxy)return proxy().tbpPayCard(tbpPayCard);  this.put("tbpPayCard", tbpPayCard);return this;};
	 	/** and tbp_pay_card is null */
 		public M tbpPayCardNull(){if(proxy)return proxy().tbpPayCardNull();if(this.get("tbpPayCardNot")==null)this.put("tbpPayCardNot", "");this.put("tbpPayCard", null);return this;};
 		/** not .... */
 		public M tbpPayCardNot(){if(proxy)return proxy().tbpPayCardNot();this.put("tbpPayCardNot", "not");return this;};
 		public M tbpPayCardNotNull(){if(proxy)return proxy().tbpPayCardNotNull();this.put("tbpPayCardNot", "not");this.put("tbpPayCard", null);return this;};
 		public M tbpPayCardNot(Object tbpPayCard){if(proxy)return proxy().tbpPayCardNot(tbpPayCard);this.put("tbpPayCardNot", "not");this.put("tbpPayCard", tbpPayCard);return this;};
	 		
			
		public M tbpPayCardIn(String ids){
			if(proxy)return proxy().tbpPayCardIn(ids);  this.put("tbpPayCardIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 审核状态    1:待处理 2:通过 3:不通过     **/
		public M tbpAuth(Object tbpAuth){if(proxy)return proxy().tbpAuth(tbpAuth);  this.put("tbpAuth", tbpAuth);return this;};
	 	/** and tbp_auth is null */
 		public M tbpAuthNull(){if(proxy)return proxy().tbpAuthNull();if(this.get("tbpAuthNot")==null)this.put("tbpAuthNot", "");this.put("tbpAuth", null);return this;};
 		/** not .... */
 		public M tbpAuthNot(){if(proxy)return proxy().tbpAuthNot();this.put("tbpAuthNot", "not");return this;};
 		public M tbpAuthNotNull(){if(proxy)return proxy().tbpAuthNotNull();this.put("tbpAuthNot", "not");this.put("tbpAuth", null);return this;};
 		public M tbpAuthNot(Object tbpAuth){if(proxy)return proxy().tbpAuthNot(tbpAuth);this.put("tbpAuthNot", "not");this.put("tbpAuth", tbpAuth);return this;};
	 		
			
		public M tbpAuthIn(String ids){
			if(proxy)return proxy().tbpAuthIn(ids);  this.put("tbpAuthIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 添加时间        **/
		public M tbpAddTime(Object tbpAddTime){if(proxy)return proxy().tbpAddTime(tbpAddTime);  this.put("tbpAddTime", tbpAddTime);return this;};
	 	/** and tbp_add_time is null */
 		public M tbpAddTimeNull(){if(proxy)return proxy().tbpAddTimeNull();if(this.get("tbpAddTimeNot")==null)this.put("tbpAddTimeNot", "");this.put("tbpAddTime", null);return this;};
 		/** not .... */
 		public M tbpAddTimeNot(){if(proxy)return proxy().tbpAddTimeNot();this.put("tbpAddTimeNot", "not");return this;};
 		public M tbpAddTimeNotNull(){if(proxy)return proxy().tbpAddTimeNotNull();this.put("tbpAddTimeNot", "not");this.put("tbpAddTime", null);return this;};
 		public M tbpAddTimeNot(Object tbpAddTime){if(proxy)return proxy().tbpAddTimeNot(tbpAddTime);this.put("tbpAddTimeNot", "not");this.put("tbpAddTime", tbpAddTime);return this;};
	 		
 		/** and tbp_add_time >= ? */
 		public M tbpAddTimeStart(Object start){if(proxy)return proxy().tbpAddTimeStart(start);this.put("tbpAddTimeStart", start);return this;};			
 		/** and tbp_add_time <= ? */
 		public M tbpAddTimeEnd(Object end){if(proxy)return proxy().tbpAddTimeEnd(end);this.put("tbpAddTimeEnd", end);return this;};
			
			
		
			
	 	
	 	public M add(String key, Object value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	 	public M add(F key, Object value) {if(proxy)return proxy().add(key,value);this.put(key.toString(), value);return this;}
	 	
	 	public M desc(C key) {if(proxy)return proxy().desc(key);this.put("desc", key.column);return this;}
	 	public M asc(C key) {if(proxy)return proxy().asc(key);this.put("asc", key.column);return this;}
	 	public M desc(String sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	 	public M asc(String sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	 	public M definex(String sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	 	
	 	/** 获取所有合伙人信息 **/
		public @api List<TbPartners> list(Integer size){			
			return getTbPartnersList(this,size);
		}
		/** 获取合伙人信息分页 **/
		public @api Page<TbPartners> page(Integer page,Integer size){			
			return getTbPartnersPage(page, size , this);
		}
		/** 根据查询条件取合伙人信息 **/
		public @api TbPartners get(){			
			return getTbPartners(this);
		}
		/** 获取合伙人信息数 **/
		public @api Long count(){			
			return getTbPartnersCount(this);
		}
		/** 获取合伙人信息表达式 **/
		public @api <T> T eval(String strEval){			
			return getTbPartnersEval(strEval,this);
		}
		
		/** 获取合伙人信息统计 **/
		public @api List<Map> stats(C sumKey,C groupKey,int dateType){			
			return getTbPartnersStats(this,sumKey,groupKey,dateType);
		}
		/** 获取合伙人信息统计 **/
		public @api List<Map> stats(C sumKey,C groupKey){			
			return getTbPartnersStats(this,sumKey,groupKey,-1);
		}
		
		/** 根据条件更新 **/
		public @api int update(){			
			M where = null;
			M set = null;
			if(this.type==0){
				if(this.linked==null)throw new RuntimeException("未发set");
				where = this;
				set = this.linked;
			}else{
				if(this.linked==null)throw new RuntimeException("未发where条件");
				set = this;
				where = this.linked;
			}
			return updateTbPartners(set,where);
		}
		/** 根据条件删除 **/
		public @api void delete(){			
			deleteTbPartners(this);
		}
	}
	
	public static class Param extends M{
		public Param(int type) {
			super(type);
		}
		public Param(int type, Boolean proxy) {
			super(type, proxy);
		}
	}
	
	/** 对象的字段描述 **/
	public static class F{
		
			
		/** 编号 [非空]       **/
		public final static @type(Long.class)  String tbpId="tbpId";
	 			
			
	 	
			
		/** 会员名称        **/
		public final static @type(String.class) @like String nickName="nickName";
	 			
			
	 	
			
		/** 会员  [Member]      **/
		public final static @type(Long.class)  String tbpMember="tbpMember";
	 			
			
	 	
			
		/** 品牌  [Merchant]      **/
		public final static @type(Long.class)  String tbpBrand="tbpBrand";
	 			
			
	 	
			
		/** 姓名        **/
		public final static @type(String.class) @like String tbpName="tbpName";
	 			
			
	 	
			
		/** 手机号        **/
		public final static @type(String.class) @like String tbpMobile="tbpMobile";
	 			
			
	 	
			
		/** 上级        **/
		public final static @type(String.class) @like String tbpTop="tbpTop";
	 			
			
	 	
			
		/** 上上级        **/
		public final static @type(String.class) @like String tbpToptop="tbpToptop";
	 			
			
	 	
			
		/** 性别        **/
		public final static @type(String.class) @like String tbpSex="tbpSex";
	 			
			
	 	
			
		/** 年龄        **/
		public final static @type(String.class) @like String tbpAge="tbpAge";
	 			
			
	 	
			
		/** 收入        **/
		public final static @type(String.class) @like String tbpSr="tbpSr";
	 			
			
	 	
			
		/** 职业        **/
		public final static @type(String.class) @like String tbpZy="tbpZy";
	 			
			
	 	
			
		/** 全称        **/
		public final static @type(String.class) @like String tbpFullName="tbpFullName";
	 			
			
	 	
			
		/** 街道地址  [Region]      **/
		public final static @type(Long.class)  String tbpJiedao="tbpJiedao";
	 			
			
	 	
			
		/** 审核理由        **/
		public final static @type(String.class) @like String tbpLiyou="tbpLiyou";
	 			
			
	 	
			
		/** 经度        **/
		public final static @type(String.class)  String tbpLongitude="tbpLongitude";
	 			
			
	 	
			
		/** 纬度        **/
		public final static @type(String.class)  String tbpLatitude="tbpLatitude";
	 			
			
	 	
			
		/** 省        **/
		public final static @type(Long.class)  String tbpProvince="tbpProvince";
	 			
		/** and tbp_province >= ? */
		public final static @type(Long.class) String tbpProvinceMin="tbpProvinceMin";
		/** and tbp_province <= ? */
		public final static @type(Long.class) String tbpProvinceMax="tbpProvinceMax";
				
			
	 	
			
		/** 市        **/
		public final static @type(Long.class)  String tbpCity="tbpCity";
	 			
		/** and tbp_city >= ? */
		public final static @type(Long.class) String tbpCityMin="tbpCityMin";
		/** and tbp_city <= ? */
		public final static @type(Long.class) String tbpCityMax="tbpCityMax";
				
			
	 	
			
		/** 县        **/
		public final static @type(Long.class)  String tbpCounty="tbpCounty";
	 			
		/** and tbp_county >= ? */
		public final static @type(Long.class) String tbpCountyMin="tbpCountyMin";
		/** and tbp_county <= ? */
		public final static @type(Long.class) String tbpCountyMax="tbpCountyMax";
				
			
	 	
			
		/** 申请时间        **/
		public final static @type(Date.class)  String tbpTime="tbpTime";
	 			
	 	/** and tbp_time >= ? */
 		public final static @type(Date.class) String tbpTimeStart="tbpTimeStart";
 		/** and tbp_time <= ? */
 		public final static @type(Date.class) String tbpTimeEnd="tbpTimeEnd";
				
			
	 	
			
		/** 是否购买卡    1:未购买 2:已购买     **/
		public final static @type(Short.class)  String tbpPayCard="tbpPayCard";
	 			
			
	 	
			
		/** 审核状态    1:待处理 2:通过 3:不通过     **/
		public final static @type(Short.class)  String tbpAuth="tbpAuth";
	 			
			
	 	
			
		/** 添加时间        **/
		public final static @type(Date.class)  String tbpAddTime="tbpAddTime";
	 			
	 	/** and tbp_add_time >= ? */
 		public final static @type(Date.class) String tbpAddTimeStart="tbpAddTimeStart";
 		/** and tbp_add_time <= ? */
 		public final static @type(Date.class) String tbpAddTimeEnd="tbpAddTimeEnd";
				
			
	 	
	 	public static String get(String name){
			try {
				Field field = F.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	/** 对象的数据库字段描述 **/
	public static enum C{
		
		tbpId("tbp_id"),
		nickName("nick_name"),
		tbpMember("tbp_member"),
		tbpBrand("tbp_brand"),
		tbpName("tbp_name"),
		tbpMobile("tbp_mobile"),
		tbpTop("tbp_top"),
		tbpToptop("tbp_toptop"),
		tbpSex("tbp_sex"),
		tbpAge("tbp_age"),
		tbpSr("tbp_sr"),
		tbpZy("tbp_zy"),
		tbpFullName("tbp_full_name"),
		tbpJiedao("tbp_jiedao"),
		tbpLiyou("tbp_liyou"),
		tbpLongitude("tbp_longitude"),
		tbpLatitude("tbp_latitude"),
		tbpProvince("tbp_province"),
		tbpCity("tbp_city"),
		tbpCounty("tbp_county"),
		tbpTime("tbp_time"),
		tbpPayCard("tbp_pay_card"),
		tbpAuth("tbp_auth"),
		tbpAddTime("tbp_add_time"),
		count("count");
		String column;
		C(String column){
			this.column = column;
		}
		public String toString(){
			return this.column;
		}
		public static String get(String name){
			try {
				Field field = C.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	
	/**
	* 获取合伙人信息数据
	**/
	public static Object getData(Object param){
		if(param==null)
			return null;
		Object value = null;
		if(param.getClass()==Long.class)
			value = TbPartners.get((Long)param);
		else if(param instanceof java.util.Map){
			java.util.Map params = (Map) param;
			if(params.get("size")==null)
				value = TbPartners.getTbPartners(params);
			else
				value = TbPartners.getTbPartnersList(params, (Integer) params.get("size"));
		}else if(param.getClass()==Long.class )
			value =  TbPartners.where().tbpId(param).get();
		else if(!Utils.empty(param.toString()))
			value = TbPartners.get(Long.valueOf(param.toString()));
		return value;
	}
	
	/**对象转json**/
	public Map toJSON(){
		return toJSON(false);
	}
	public Map toJSON(boolean simple){
		return toJSON(simple,0);
	}
	public Map toJSON(boolean simple,int step){
		Map map = new HashMap();
		map.put("id",this.getTbpId());
	
		Utils.fms(map,simple?"id":"tbpId",this.getTbpId(),this.getTbpId$());
		
			
 		
	
		Utils.fms(map,simple?"name":"nickName",this.getNickName(),this.getNickName$());
		
			
 		
	
		Utils.fms(map,simple?"member":"tbpMember",this.getTbpMember(),this.getTbpMember$());
		
			
 		
	
		Utils.fms(map,simple?"brand":"tbpBrand",this.getTbpBrand(),this.getTbpBrand$());
		
			
 		
	
		Utils.fms(map,simple?"name":"tbpName",this.getTbpName(),this.getTbpName$());
		
			
 		
	
		Utils.fms(map,simple?"mobile":"tbpMobile",this.getTbpMobile(),this.getTbpMobile$());
		
			
 		
	
		Utils.fms(map,simple?"top":"tbpTop",this.getTbpTop(),this.getTbpTop$());
		
			
 		
	
		Utils.fms(map,simple?"toptop":"tbpToptop",this.getTbpToptop(),this.getTbpToptop$());
		
			
 		
	
		Utils.fms(map,simple?"sex":"tbpSex",this.getTbpSex(),this.getTbpSex$());
		
			
 		
	
		Utils.fms(map,simple?"age":"tbpAge",this.getTbpAge(),this.getTbpAge$());
		
			
 		
	
		Utils.fms(map,simple?"sr":"tbpSr",this.getTbpSr(),this.getTbpSr$());
		
			
 		
	
		Utils.fms(map,simple?"zy":"tbpZy",this.getTbpZy(),this.getTbpZy$());
		
			
 		
	
		Utils.fms(map,simple?"fullName":"tbpFullName",this.getTbpFullName(),this.getTbpFullName$());
		
			
 		
	
		Utils.fms(map,simple?"jiedao":"tbpJiedao",this.getTbpJiedao(),this.getTbpJiedao$());
		
			
 		
	
		Utils.fms(map,simple?"liyou":"tbpLiyou",this.getTbpLiyou(),this.getTbpLiyou$());
		
			
 		
	
		Utils.fms(map,simple?"longitude":"tbpLongitude",this.getTbpLongitude(),this.getTbpLongitude$());
		
			
 		
	
		Utils.fms(map,simple?"latitude":"tbpLatitude",this.getTbpLatitude(),this.getTbpLatitude$());
		
			
 		
	
		Utils.fms(map,simple?"province":"tbpProvince",this.getTbpProvince(),this.getTbpProvince$());
		
			
 		
	
		Utils.fms(map,simple?"city":"tbpCity",this.getTbpCity(),this.getTbpCity$());
		
			
 		
	
		Utils.fms(map,simple?"county":"tbpCounty",this.getTbpCounty(),this.getTbpCounty$());
		
			
 		
	
		Utils.fms(map,simple?"time":"tbpTime",this.getTbpTime(),this.getTbpTime$());
		
			
 		
	
		Utils.fms(map,simple?"payCard":"tbpPayCard",this.getTbpPayCard(),this.getTbpPayCard$());
		
			
 		
	
		Utils.fms(map,simple?"auth":"tbpAuth",this.getTbpAuth(),this.getTbpAuth$());
		
			
 		
	
		Utils.fms(map,simple?"addTime":"tbpAddTime",this.getTbpAddTime(),this.getTbpAddTime$());
		
		map.put("atime",this.getTbpAddTime$());map.put("ctime",this.getTbpAddTime$());
		
			
 		
	
		if(this.suffix!=null)map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOJSON************/
		/************LAZY3Q_DEFINE_TOJSON************/
		return map;
	}
	/**对象转map**/
	public Map toMap(){
		Map map = new HashMap();
	
		map.put("tbpId",this.getTbpId());
 		
	
		map.put("nickName",this.getNickName());
 		
	
		map.put("tbpMember",this.getTbpMember());
 		
	
		map.put("tbpBrand",this.getTbpBrand());
 		
	
		map.put("tbpName",this.getTbpName());
 		
	
		map.put("tbpMobile",this.getTbpMobile());
 		
	
		map.put("tbpTop",this.getTbpTop());
 		
	
		map.put("tbpToptop",this.getTbpToptop());
 		
	
		map.put("tbpSex",this.getTbpSex());
 		
	
		map.put("tbpAge",this.getTbpAge());
 		
	
		map.put("tbpSr",this.getTbpSr());
 		
	
		map.put("tbpZy",this.getTbpZy());
 		
	
		map.put("tbpFullName",this.getTbpFullName());
 		
	
		map.put("tbpJiedao",this.getTbpJiedao());
 		
	
		map.put("tbpLiyou",this.getTbpLiyou());
 		
	
		map.put("tbpLongitude",this.getTbpLongitude());
 		
	
		map.put("tbpLatitude",this.getTbpLatitude());
 		
	
		map.put("tbpProvince",this.getTbpProvince());
 		
	
		map.put("tbpCity",this.getTbpCity());
 		
	
		map.put("tbpCounty",this.getTbpCounty());
 		
	
		map.put("tbpTime",this.getTbpTime());
 		
	
		map.put("tbpPayCard",this.getTbpPayCard());
 		
	
		map.put("tbpAuth",this.getTbpAuth());
 		
	
		map.put("tbpAddTime",this.getTbpAddTime());
 		
	
		map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOMAP************/
		/************LAZY3Q_DEFINE_TOMAP************/
		return map;
	}
	/**map转对象**/
	public static TbPartners fromMap(Map map){
		TbPartners tbPartners = new TbPartners();
	
		tbPartners.tbpId = Utils.parseLong(map.get("tbpId"));
 		
	
	
		tbPartners.tbpMember = Utils.parseLong(map.get("tbpMember"));
 		
	
		tbPartners.tbpBrand = Utils.parseLong(map.get("tbpBrand"));
 		
	
		tbPartners.tbpName = Utils.parseString(map.get("tbpName"));
 		
	
		tbPartners.tbpMobile = Utils.parseString(map.get("tbpMobile"));
 		
	
		tbPartners.tbpTop = Utils.parseString(map.get("tbpTop"));
 		
	
		tbPartners.tbpToptop = Utils.parseString(map.get("tbpToptop"));
 		
	
		tbPartners.tbpSex = Utils.parseString(map.get("tbpSex"));
 		
	
		tbPartners.tbpAge = Utils.parseString(map.get("tbpAge"));
 		
	
		tbPartners.tbpSr = Utils.parseString(map.get("tbpSr"));
 		
	
		tbPartners.tbpZy = Utils.parseString(map.get("tbpZy"));
 		
	
		tbPartners.tbpFullName = Utils.parseString(map.get("tbpFullName"));
 		
	
		tbPartners.tbpJiedao = Utils.parseLong(map.get("tbpJiedao"));
 		
	
		tbPartners.tbpLiyou = Utils.parseString(map.get("tbpLiyou"));
 		
	
		tbPartners.tbpLongitude = Utils.parseString(map.get("tbpLongitude"));
 		
	
		tbPartners.tbpLatitude = Utils.parseString(map.get("tbpLatitude"));
 		
	
		tbPartners.tbpProvince = Utils.parseLong(map.get("tbpProvince"));
 		
	
		tbPartners.tbpCity = Utils.parseLong(map.get("tbpCity"));
 		
	
		tbPartners.tbpCounty = Utils.parseLong(map.get("tbpCounty"));
 		
	
		tbPartners.tbpTime = Utils.parseDate(map.get("tbpTime"));
 		
	
		tbPartners.tbpPayCard = Utils.parseShort(map.get("tbpPayCard"));
 		
	
		tbPartners.tbpAuth = Utils.parseShort(map.get("tbpAuth"));
 		
	
		tbPartners.tbpAddTime = Utils.parseDate(map.get("tbpAddTime"));
 		
	
		return tbPartners;
	}
	
	
	/**字段设置标记队列**/
	private Map<String,Boolean> seted=new HashMap();
	public Boolean getSeted(String key){
		return seted.get(key);
	}
	public void setSeted(String key){
		seted.put(key,true);
	}
	/**同步未set的字段**/
	public void mergeSet(TbPartners old){
		Field[] fields = this.getClass().getDeclaredFields();
		try {
			for(Field field:fields){
				String key = field.getName();
				if(seted.get(key)==null && field.getAnnotation(column.class)!=null){
					field.setAccessible(true);
					field.set(this, field.get(old));					
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
		
	/**自定义变量存储**/
	private Map values=new HashMap();
	public Map getValues(){
		return values;
	}
	public void setValues(String name,Object value){
		values.put(name,value);
	}
	
	/**分表时的表名后缀**/
	private String suffix;
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	
	
	/**获取数据库名称**/
	public static String getDataBaseName(){
		return Utils.config("spring.datasource.distribute_sys.name");
	}
	
	
	public static String getIcon(){
		return "/images/icons/Identification card.png";
	}
	public static String getIconfont(){
		return "icon-gerenxinxi";
	}
	public static enum ACT{
		列表,详情,审核
	};
	public static String getUrl(ACT act,TbPartners.M params){
		if(params==null)params=new TbPartners.M(0);
		params.remove("joins");
		params.remove("definexs");
		params.remove("distinct");
		String strUrl = "/admin/partner/partners.edit.html?";
		if(params.get("tbpId")!=null){
			strUrl+="&id="+Utils.encode(""+params.get("tbpId"),Utils.UTF8);
		}
		if(act==ACT.列表){
			strUrl = "/admin/partner/partners.html?1=1";
		
		
		}else if(act==ACT.详情){
			strUrl+="&edittype=detail";
		
		}else if(act==ACT.审核){
			strUrl+="&edittype=check";			
		
		}		
		if(params!=null){
			for(Object key:params.keySet()){
				strUrl+="&"+key+"="+Utils.encode(""+params.get(key),Utils.UTF8)+"";
			}
		}
		return strUrl;
	}
	public String getDetailUrl(){
		return this.getUrl(ACT.详情, where.tbpId(this.getId()));
	}
	
	/**
	* 转跳到当前地址
	**/
	public static Protocol redirect(TbPartners.ACT act,TbPartners.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_REDIRECT");
		protocol.set("url",TbPartners.getUrl(act, params));
		return protocol;
	}
	/**
	* 打开一个新的tab页面
	**/
	public static Protocol href(TbPartners.ACT act,TbPartners.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_HREF");
		protocol.set("url",TbPartners.getUrl(act, params));
		protocol.set("title",act.name());
		return protocol;
	}
	/**
	* 显示一个消息框，并且关闭当前的对话框
	**/
	public static Protocol message(String message){
		Protocol protocol = Protocol.create(true,null,"ACT_MESSAGE");
		protocol.set("message",message);
		return protocol;
	}
	
	
	static com.distribute.framework.dao.ITbPartnersDao getTbPartnersDao(){
		return Utils.getBean("tbPartnersDao");
	};
	
}